<!--#include file="lib/utf-8.asp"-->
<%
Response.ContentType = "application/json"
function getHTTPPage(url)
    dim Http
    set Http=server.createobject("MSXml2.XmlHTTP")
    Http.open "GET",url,false
    Http.send()
    if Http.readystate<>4 then
		exit function
    else    
       If Http.status=200 Then
           response.write replace(BytesToBstr(http.responseBody,"utf-8"),chr(10),"")
       End If
    end if
    getHTTPPage=bytesToBSTR(Http.responseBody,"utf-8")
    set http=nothing
    if err.number<>0 then err.Clear
end function
Function BytesToBstr(body,Cset)'转换代码，不然全是乱码
    dim objstream
    set objstream = Server.CreateObject("adodb.stream")
    objstream.Type = 1
    objstream.Mode =3
    objstream.Open
    objstream.Write body
    objstream.Position = 0
    objstream.Type = 2
    objstream.Charset = Cset
    BytesToBstr = objstream.ReadText
    objstream.Close
    set objstream = nothing
End Function
Dim url,Html
    url=Request("url")
    'Url="https://www.google.com/latitude/apps/badge/api?user="&user&"&type=json"
    'Url="http://221.12.55.171:8889/getpositionTP.asp?regnum="&user
		Html = getHTTPPage(url)
    'Response.write Html
'此代码修改自http://www.stubc.com/thread-465-1-3.html
    %>
